package com.wlhse.service.impl;

import com.wlhse.dao.SupervisionTaskDetailDao;
import com.wlhse.dto.SupervisionTaskDto;
import com.wlhse.entity.SuperVisionTaskDetailPojo;
import com.wlhse.exception.WLHSException;
import com.wlhse.service.SupervisionTaskDetailService;
import com.wlhse.util.state_code.NR;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class SupervisionTaskDetailServiceImpl implements SupervisionTaskDetailService {

    @Resource
    private SupervisionTaskDetailDao supervisionTaskDetailDao;

    @Override
    public String queryTaskDetail(String supervisionTaskCode) {
        return NR.r(supervisionTaskDetailDao.queryTaskDetail(supervisionTaskCode));
    }

    @Override
    public String updateSupervisionTask(SupervisionTaskDto supervisionTaskDto) {
        int i = supervisionTaskDetailDao.updateSupervisionTask(supervisionTaskDto);
        if(i>0){
            return NR.r();
        }
        else{
            throw new WLHSException("修改失败！");
        }
    }
}
